# -*- coding: utf-8 -*-
import pytest
import yaml
import os

# D:\PythonCk24\pytest_practice\data
from pytest_practice.base.base import Base


def read_yml(yml_name, dataname):
    path = os.path.join(os.path.dirname(os.path.abspath(os.path.dirname(os.path.abspath(__file__)))), 'data')
    with open(os.path.join(path, yml_name), encoding='utf-8') as f:
        data = yaml.safe_load(f)[dataname]
        return data


print(read_yml('111.yml', 'add_p0'))


class Test_Div(Base):
    @pytest.mark.parametrize(**read_yml('111.yml', 'add_p0'))
    def test_div(self, a, b, expect):
        result = self.cal.div(a, b)
        assert result == expect
